<?xml version="1.0" encoding="UTF-8"?>
<!--
To change this template, choose Tools | Templates
and open the template in the editor.
-->
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
	xmlns:p="http://primefaces.org/ui"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets">
    <body>
        <h:panelGrid width="100%" columnClasses="column1,column1" columns="2">
              <p:accordionPanel>
		    <p:tab title="Duyurular">
			  <p:dataList  value="#{HomePageBean.studentAnnouncement()}" var="ann">
				<p:column>
				    <h:panelGrid columns="1">
                                        <h:outputText escape="false" value="#{ann.text}"/>
					  <p:commandLink value="${ann.teacher.fullName}" action="#{HomePageBean.clickTeacher()}" ajax="false">
						<f:setPropertyActionListener value="#{ann.teacher}" target="#{TeacherBean.target}"/>
					  </p:commandLink>
				    </h:panelGrid>
				</p:column>
			  </p:dataList>
		    </p:tab>
                  <p:tab rendered="#{HomePageBean.userIsTeacher()==false}" title="Gönderdiğim Ödevler">
                      <p:dataList var="ans" value="#{HomeworkBean.studentAnswer}">
			  <p:column>
				<h:panelGrid columns="2">
                                    <h:outputLabel value="Sonuç: "/>
                                    <h:outputLabel value="#{ans.score}"/>
                                    <h:outputLabel value="Okuyan: "/>
                                    <p:commandLink value="${ans.teacher.fullName}" action="#{HomePageBean.clickTeacher()}" ajax="false">
						<f:setPropertyActionListener value="#{ans.teacher}" target="#{TeacherBean.target}"/>
                                </p:commandLink>
                                    <p:commandLink ajax="false" value="Cevabı Gör" onclick="answer.show();">
                                    <f:setPropertyActionListener value="#{ans}" target="#{HomeworkBean.targetAnswer}"/>
				</p:commandLink>
				</h:panelGrid>
			  </p:column>
		    </p:dataList>
                  </p:tab>
              </p:accordionPanel>
		<h:panelGroup>
		    <h:outputLabel value="Bu haftadaki etkinlikleriniz: "/>
                    <p:schedule aspectRatio="20" locale="tr"  value="#{HomePageBean.eventModel}"/>
		</h:panelGroup>
	  </h:panelGrid>
    </body>
</html>
